import React from 'react'
import { Icon } from 'antd-mobile'
// clickFn
// icon
// title
// midtext
// fold
class App extends React.Component {
  render () {
    return (
      <div className={`${this.props.fold === undefined ? 'g-fold-title-wrap clearfix ell' : 'g-fold-title-wrap clearfix cursor-pointer ell'} ${this.props.className || ''}`} onClick={this.props.clickFn}>
        <span className='g-fold-title'>
          {!!this.props.icon &&
            <i className={'iconfont f18 vt mr10 ' + this.props.icon} />
          }

          <span className='strong'>{this.props.title}</span>
        </span>

        {!!this.props.midtext &&
        <span className='ml20 f14 fc8a'>{this.props.midtext}</span>
        }

        {this.props.fold !== undefined &&
          <span className='g-fold-operation fr'>
            {
              this.props.fold ? (
                <Icon type='down' className='f14 pl5' />
              )
                : (
                  <Icon type='up' className='f14 ml5 mb5' />
                )
            }
          </span>
        }

        {!!this.props.righttext &&
        <p className='fr ml20 f14 fc8a'>{this.props.righttext}</p>
        }

      </div>
    )
  }
}

module.exports = App
